﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web;
using System.Web.Routing;

namespace Shop.Web.Infrastructure.Web
{
    public class CDNClient
    {
        public static MvcHtmlString CreateLink(params string[] paths)
        {
            StringBuilder result = new StringBuilder();
            foreach (string path in paths)
            {
                result.AppendFormat("<link href='{0}' rel='stylesheet' type='text/css' />", VirtualPathUtility.ToAbsolute(path));
            }
            return new MvcHtmlString(result.ToString());
        }

        public static MvcHtmlString CreateScript(params string[] paths)
        {
            StringBuilder result = new StringBuilder();
            foreach (string path in paths)
            {
                result.AppendFormat("<script src=\"{0}\" type=\"text/javascript\"></script>", VirtualPathUtility.ToAbsolute(path));
            }
            return new MvcHtmlString(result.ToString());
        }
    }
}
